package com.avic.rong.listener;

import android.content.Context;

import com.avic.rong.bean.HomeBean;

import java.util.List;

import cc.ibooker.ztextviewlib.AutoVerticalScrollTextViewUtil;

/**
 * Creater: Created by wangyz on 2018/12/25.
 * Email: 936804097@qq.com
 */
public class NoticeItemOnClickListener  implements AutoVerticalScrollTextViewUtil.OnMyClickListener{

    private AutoVerticalScrollTextViewUtil textViewUtil;
    private Context mContext;
    private List<HomeBean.CriterionBean> noticeList;

    public NoticeItemOnClickListener(AutoVerticalScrollTextViewUtil textViewUtil, Context context,List<HomeBean.CriterionBean> noticeList) {
        this.textViewUtil = textViewUtil;
        this.mContext = context;
        this.noticeList = noticeList;
    }

    @Override
    public void onMyClickListener(int position, CharSequence charSequence) {
        if (textViewUtil.getIsRunning()) {
            // 停止滚动
            textViewUtil.stop();
        } else {
            // 开启滚动
            textViewUtil.start();
        }

        int targetId = noticeList.get(position).getTargetId();
//        mContext.startActivity(NoticeDetailActivity.queryIntent(mContext, AppUtils.BASE_URL + "app/biaozhun/noticeDetail/" + targetId));
    }
}


